﻿#include "DialogContact.h"

#include <QtGui>

DialogContact::DialogContact(QString strName, QWidget * parent, Qt::WFlags f): QDialog(parent, f)
{
	setFixedSize(QSize(480,320));

    QTabWidget* tabWidget = new QTabWidget(this);

	
	QWidget* widPageGeneral = new QWidget();
	
	tabWidget->addTab(widPageGeneral, tr("Normal"));
	{
		QVBoxLayout *tl = new QVBoxLayout();
		QGridLayout *mainLayout = new QGridLayout();

		QLabel *fileNameLabel = new QLabel(tr("Name:"),widPageGeneral);
		m_editName = new QLineEdit(widPageGeneral);
		m_editName->setMinimumWidth(300);
		mainLayout->addWidget(fileNameLabel,0,0,Qt::AlignLeft);
		mainLayout->addWidget(m_editName,0,1,1,4,Qt::AlignLeft);

		QLabel *mobileLabel = new QLabel(tr("Mobile:"),widPageGeneral);
		m_editMobile = new QLineEdit(widPageGeneral);
		m_editMobile->setMinimumWidth(300);
		mainLayout->addWidget(mobileLabel,1,0,Qt::AlignLeft);
		mainLayout->addWidget(m_editMobile,1,1,1,4,Qt::AlignLeft);

		QLabel *emailLabel = new QLabel(tr("Email:"),widPageGeneral);
		m_editEmail = new QLineEdit(widPageGeneral);
		m_editEmail->setMinimumWidth(300);
		mainLayout->addWidget(emailLabel,2,0,Qt::AlignLeft);
		mainLayout->addWidget(m_editEmail,2,1,1,4,Qt::AlignLeft);

		QLabel *emailComment = new QLabel(tr("Atth:"),widPageGeneral);
		m_editComment = new QTextEdit(widPageGeneral);
		m_editComment->setFixedWidth(400);
		mainLayout->addWidget(emailComment,3,0,Qt::AlignLeft);
		mainLayout->addWidget(m_editComment,4,0,1,5,Qt::AlignLeft);

		tl->addLayout(mainLayout);
		tl->addStretch(1);
		widPageGeneral->setLayout(tl);
	}

    tabWidget->addTab(new QWidget(), tr("Personal"));

    tabWidget->addTab(new QWidget(), tr("Family"));

    tabWidget->addTab(new QWidget(), tr("Company"));

	tabWidget->addTab(new QWidget(), tr("Other"));



    QPushButton *okButton = new QPushButton(tr("OK"));
    QPushButton *cancelButton = new QPushButton(tr("Cancel"));

    connect(okButton, SIGNAL(clicked()), this, SLOT(accept()));
    connect(cancelButton, SIGNAL(clicked()), this, SLOT(reject()));

    QHBoxLayout *buttonLayout = new QHBoxLayout;
    buttonLayout->addStretch(1);
    buttonLayout->addWidget(okButton);
    buttonLayout->addWidget(cancelButton);

    QVBoxLayout *mainLayout = new QVBoxLayout;
    mainLayout->addWidget(tabWidget);
    mainLayout->addLayout(buttonLayout);
    setLayout(mainLayout);

    setWindowTitle(strName + tr(" Contact Details"));

}

DialogContact::~DialogContact(void)
{
}



void DialogContact::setMode(int)
{
}
